package aliens 
{
	import aliens.tasks.subTasks.SubTask;
	import aliens.tasks.Task;
	import caves.AbstractSpace;
	import caves.points.SpacePoint;
	import flash.display.Bitmap;
	import flash.display.BitmapData;
	import flash.geom.Point;
	/**
	 * ...
	 * @author Jeroen Gildemacher
	 */
	public class Alien 
	{
		public static const BASE_ALIEN:String = "base";
		protected var controller:AlienController;
		protected var _home:Point;
		protected var _mapX:Number = 0;
		protected var _mapY:Number = 0;
		protected var _currentTask:Task;
		protected var _currentSubTask:int;
		protected var _route:Vector.<AbstractSpace>;
		protected var _lockedPoints:Vector.<SpacePoint>;
		
		public function Alien(controller:AlienController) 
		{
			this.controller = controller;
		}
		
		public function getNextSubTask():void {
			if (_currentSubTask == _currentTask.subTasks.length - 1) {
				_currentSubTask = 0;
				controller.getNewTask(this);
				
			} else _currentSubTask ++;
		}
		
		
		//  GETTERS AND SETTERS
		public function get mapX():Number 
		{
			return _mapX;
		}
		
		public function set mapX(value:Number):void 
		{
			_mapX = value;
		}
		
		public function get mapY():Number
		{
			return _mapY;
		}
		
		public function set mapY(value:Number):void 
		{
			_mapY = value;
		}
		
		public function get home():Point 
		{
			return _home;
		}
		
		public function set home(value:Point):void 
		{
			_home = value;
		}
		
		public function get currentTask():Task 
		{
			return _currentTask;
		}
		
		public function set currentTask(value:Task):void 
		{
			_currentTask = value;
		}
		
		public function get currentSubTask():int 
		{
			return _currentSubTask;
		}
		
		public function set currentSubTask(value:int):void 
		{
			_currentSubTask = value;
		}
		
		public function get route():Vector.<AbstractSpace> 
		{
			return _route;
		}
		
		public function set route(value:Vector.<AbstractSpace>):void 
		{
			_route = value;
		}
		
		public function get lockedPoints():Vector.<SpacePoint> 
		{
			return _lockedPoints;
		}
		
		public function set lockedPoints(value:Vector.<SpacePoint>):void 
		{
			_lockedPoints = value;
		}
		
		public function getMapPos():Point {
			return new Point(_mapX, _mapY);
		}
		
		
	}

}